<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>订单添加产品</title>
		<meta name="keywords" content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" />
		<meta name="description" content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<!-- basic styles -->

		<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
        <link rel="stylesheet"  href="assets/css/kkpager_orange.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- ace styles -->

		<link rel="stylesheet" href="assets/css/ace.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="assets/js/html5shiv.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
		<#include "header.ftl"/>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "left_list_menu.ftl">
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="selectOrderList?order_type=0&page=1&order_status=0">订单管理</a>
							</li>

							<li>
								添加产品信息列表
							</li>
						</ul><!-- .breadcrumb -->

					</div>

					<div class="page-content">
						<div class="page-header">
							<#--<h1>-->
								<#--管理员列表-->
								<#--&lt;#&ndash;<small>&ndash;&gt;-->
									<#--&lt;#&ndash;<i class="icon-double-angle-right"></i>&ndash;&gt;-->
									<#--&lt;#&ndash;Static &amp; Dynamic Tables&ndash;&gt;-->
								<#--&lt;#&ndash;</small>&ndash;&gt;-->
							<#--</h1>-->
                                <input type="text" name="service_back_key" id="service_back_key" placeholder="请输入产品型号" value="${serviceProject.service_back !''}"/>
                                &nbsp;&nbsp;<label> 分类 :</label>&nbsp;
                                <select id="service_class_key"  disabled="disabled">
                                    <#if serviceProject.service_class == 1>
                                        <option value="1" selected ="selected">空调</option>
                                    <#else >
                                        <option value="1">空调</option>
                                    </#if>
                                    <#if serviceProject.service_class == 2>
                                        <option value="2" selected ="selected">地暖</option>
                                    <#else >
                                        <option value="2" >地暖</option>
                                    </#if>
                                    <#if serviceProject.service_class == 3>
                                        <option value="3" selected ="selected">新风</option>
                                    <#else >
                                        <option value="3">新风</option>
                                    </#if>
                                    <#if serviceProject.service_class == 4>
                                        <option value="4" selected ="selected">生活热水</option>
                                    <#else >
                                        <option value="4">生活热水</option>
                                    </#if>
                                    <#if serviceProject.service_class == 5>
                                        <option value="5" selected ="selected">水处理</option>
                                    <#else >
                                        <option value="5">水处理</option>
                                    </#if>
                                    <#if serviceProject.service_class == 6>
                                        <option value="6" selected ="selected">智能家居</option>
                                    <#else >
                                        <option value="6">智能家居</option>
                                    </#if>
                                </select>
                                &nbsp;<label> 种类 :</label>&nbsp;
                                <select id="service_kind_key"  onchange="changeLableMenu(${order_id?c},'OrderAddServiceProject')">
                                    <option value="0">请选择</option>
                                <#if serviceProject.service_kind == 1>
                                    <option value="1" selected="selected">民用</option>
                                <#else >
                                    <option value="1">民用</option>
                                </#if>
                                <#if serviceProject.service_kind == 2>
                                    <option value="2" selected="selected">商用</option>
                                <#else >
                                    <option value="2">商用</option>
                                </#if>
                                </select>
                                &nbsp;<label> 品牌 :</label>&nbsp;
                                <select id="service_brand_key">
                                    <option value="0">请选择</option>
                                    <#list lableInfos as lableList>
                                        <#if lableList.lable_type == 1>
                                            <#if lableList.lable_id == serviceProject.service_brand >
                                                <option value="${lableList.lable_id}" selected="selected">${lableList.lable_name}</option>
                                            <#else>
                                                <option value="${lableList.lable_id}" >${lableList.lable_name}</option>
                                            </#if>
                                        </#if>
                                    </#list>
                                </select>
                                &nbsp;<label> 规格 :</label>&nbsp;
                                <select id="service_standard_key">
                                    <option value="0">请选择</option>
                                    <#list lableInfos as lableList>
                                        <#if lableList.lable_type == 2>
                                            <#if lableList.lable_id == serviceProject.service_standard >
                                                <option value="${lableList.lable_id}" selected="selected">${lableList.lable_name}</option>
                                            <#else>
                                                <option value="${lableList.lable_id}" >${lableList.lable_name}</option>
                                            </#if>
                                        </#if>
                                    </#list>
                                </select>
                                &nbsp;<label> 部件 :</label>&nbsp;
                                <select id="service_assembly_key">
                                    <option value="0">请选择</option>
                                <#list lableInfos as lableList>
                                    <#if lableList.lable_type == 3>
                                        <#if lableList.lable_id == serviceProject.service_assembly >
                                            <option value="${lableList.lable_id}" selected="selected">${lableList.lable_name}</option>
                                        <#else>
                                            <option value="${lableList.lable_id}" >${lableList.lable_name}</option>
                                        </#if>
                                    </#if>
                                </#list>
                                </select>

                                <button id="search_service_project" type="button" class="btn btn-sm btn-primary">
                                    <i class="icon-search"></i>
                                    搜索
                                </button>
							<span>
                        		<a href="selectOrderDetailById?order_id=${order_id !""}">
                                    <button type="button" class="btn btn-primary btn-sm"  style="float: right;">返回订单详情</button>
                                </a>
                    		</span>
						</div><!-- /.page-header -->


                        <!-- 添加管理员 -->
                        <div class="modal fade" id="addServiceProject" data-backdrop="static" data-keyboard="true">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal">
                                            <span>&times;</span>
                                        </button>
                                        <h4 class="modal-title"> 添加产品</h4>
                                    </div>
                                    <div class="modal-body">
                                        <form id="addCustomerForm" role="form" class="form-horizontal">
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">名称 :</label>
                                                <div class="col-sm-6">
                                                    <input type="text" name="admin_name" class="form-control" />
                                                </div>
                                                <p class="form-control-static col-sm-1" style="color:red">*</p>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">电话 :</label>
                                                <div class="col-sm-6">
                                                    <input type="text" name="admin_phone" onkeyup="value=value.replace(/[^\d]/g,'')" class="form-control" />
                                                </div>
                                                <p class="form-control-static col-sm-1" style="color:red">*</p>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">登录名 :</label>
                                                <div class="col-sm-6">
                                                    <input type="text" name="user_login_name" class="form-control" />
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">密码 :</label>
                                                <div class="col-sm-6">
                                                    <input type="text" name="password" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-3 control-label">类型 :</label>
                                                <div class="col-sm-6">
                                                    <select style="width:150px" id="admin_type" name="admin_type">
														<option value="0">请选择</option>
														<option value="1">超级管理员</option>
														<option value="2">客服管理员</option>
													</select>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-primary btn-sm"  id="addAdmin">保存</button>
                                    </div>
                                </div>
                            </div>
                        </div>


						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="row">
									<div class="col-xs-12">
										<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>产品编号</th>
														<th>产品名称</th>
														<th>分类</th>
														<th>种类</th>
														<th>品牌</th>
														<th>规格</th>
														<th>部件</th>
														<th>原价</th>
														<th>维修价</th>
														<th>产品总价</th>
														<th>型号</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													<#list serviceProjects as list>
														<tr>
															<td>${list.service_id}</td>
															<td>${list.service_name !""}</td>
															<td>
                                                                <#if list.service_class == 1>
                                                                    空调
                                                                <#elseif list.service_class == 2>
                                                                    地暖
                                                                <#elseif list.service_class == 3>
                                                                    新风
                                                                <#elseif list.service_class == 4>
                                                                    生活热水
                                                                <#elseif list.service_class == 5>
                                                                    水处理
                                                                <#elseif list.service_class == 6>
                                                                    智能家居
                                                                </#if>
                                                            </td>
															<td>
                                                                <#if list.service_kind == 1>
                                                                    民用
                                                                <#elseif list.service_kind == 2>
                                                                    商用
                                                                </#if>
                                                            </td>
															<td>${list.service_brand_name !""}</td>
															<td>${list.service_standard_name !""}</td>
															<td>${list.service_assembly_name !""}</td>
															<td>${list.service_price !""}</td>
															<td>${list.maintenance_cost !""}</td>
															<td>${list.service_all_price !""}</td>
															<td>${list.service_back !""}</td>
															<td>
																<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                                                        <button class="btn btn-xs btn-success" onclick="detailThis(${list.service_id?c},'selectServiceProjectById?service_id=')">
                                                                            详情
                                                                        </button>
																		<button class="btn btn-xs btn-warning" onclick="orderAddServiceProject(${order_id?c},${list.service_id?c})">
                                                                            添加
																		</button>
																</div>

																<div class="visible-xs visible-sm hidden-md hidden-lg">
																	<div class="inline position-relative">
																		<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
																			<i class="icon-cog icon-only bigger-110"></i>
																		</button>

																		<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
																			<li>
																				<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																					<span class="green">
																						<i class="icon-edit bigger-120"></i>
																					</span>
																				</a>
																			</li>

																			<li>
																				<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
																					<span class="red">
																						<i class="icon-trash bigger-120"></i>
																					</span>
																				</a>
																			</li>
																		</ul>
																	</div>
																</div>
															</td>
														</tr>
													</#list>
												</tbody>
											</table>
                                            <!-- 编辑管理员信息 -->
                                            <div class="modal fade" id="editAdminInfo">
                                                <div class="modal-dialog">
                                                    <div class="modal-content">
                                                        <div class="modal-header">
                                                            <button type="button" class="close">
                                                                <span aria-hidden="true" data-dismiss="modal">&times;</span><span class="sr-only">close</span>
                                                            </button>
                                                            <h4 class="modal-title">修改管理员信息</h4>
                                                        </div>
                                                        <div class="modal-body">
                                                            <form role="form" id="editAdminInfoForm" class="form-horizontal">
                                                                <input type="text" class="form-control" id="info_id" name="info_id" placeholder="" style="display: none">
                                                                <div class="form-group">
                                                                    <label class="control-label col-sm-3">姓名</label>
                                                                    <div class="col-sm-6">
                                                                        <input type="text" class="form-control" id="info_name" name="info_name" placeholder="">
                                                                    </div>
                                                                    <p class="form-control-static col-sm-1" style="color:red">*</p>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-sm-3">手机</label>
                                                                    <div class="col-sm-6">
                                                                        <input type="text" class="form-control" id="info_phone" name="info_phone"  placeholder="">
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-sm-3">用户名</label>
                                                                    <div class="col-sm-4">
                                                                        <input type="text" class="form-control" id="info_login_name" name="info_login_name" onkeyup="value=value.replace(/[^\d]/g,'')">
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-sm-3">密码</label>
                                                                    <div class="col-sm-6">
                                                                        <input type="text" class="form-control" id="info_login_password" name="info_login_password"  placeholder="">
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="col-sm-3 control-label">类型 :</label>
                                                                    <div class="col-sm-6">
                                                                        <select style="width:150px" id="info_type" name="info_type">
                                                                            <option value="0">请选择</option>
                                                                            <option value="1">超级管理员</option>
                                                                            <option value="2">客服管理员</option>
                                                                        </select>
                                                                    </div>
                                                                </div>
                                                            </form>
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" class="btn btn-primary btn-sm" id="saveEditAdminInfoForm">保存</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="modal-footer no-margin-top">
                                                <div id="kkpager"></div>
												<#--<span class="pagination pull-left  no-margin" style="padding:7px">-->
													<#--总共${pageInfo.count_info}条数据,现显示${pageInfo.start_info}至${pageInfo.end_info}条-->
												<#--</span>-->
                                                <#--&lt;#&ndash;<button class="btn btn-sm btn-danger pull-left" data-dismiss="modal">&ndash;&gt;-->
                                                    <#--&lt;#&ndash;<i class="icon-remove"></i>&ndash;&gt;-->
                                                    <#--&lt;#&ndash;Close&ndash;&gt;-->
                                                <#--&lt;#&ndash;</button>&ndash;&gt;-->

                                                <#--<ul class="pagination pull-right no-margin">-->
                                                    <#--<li class="prev disabled">-->
                                                        <#--<a href="#">-->
                                                            <#--<i class="icon-double-angle-left"></i>-->
                                                        <#--</a>-->
                                                    <#--</li>-->
													<#--<#list pageModels as pageList>-->
														<#--<#if pageList.page_status == 2>-->
                                                            <#--<li class="active">-->
                                                                <#--<a href="${pageList.page_href}">${pageList.page_index}</a>-->

                                                            <#--</li>-->
														<#--<#else>-->
                                                            <#--<li>-->
                                                                <#--<a href="${pageList.page_href}">${pageList.page_index}</a>-->
                                                            <#--</li>-->
														<#--</#if>-->
													<#--</#list>-->
                                                    <#--<li class="next">-->
                                                        <#--<a href="#">-->
                                                            <#--<i class="icon-double-angle-right"></i>-->
                                                        <#--</a>-->
                                                    <#--</li>-->
                                                <#--</ul>-->
                                            </div>
										</div><!-- /.table-responsive -->
									</div><!-- /span -->
								</div><!-- /row -->

								<div class="hr hr-18 dotted hr-double"></div>
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->


		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
        <script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script>
		<script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<script src="assets/js/jquery.dataTables.min.js"></script>
		<script src="assets/js/jquery.dataTables.bootstrap.js"></script>

		<!-- ace scripts -->

		<script src="assets/js/ace-elements.min.js"></script>
		<script src="assets/js/ace.min.js"></script>
		<script src="assets/js/myJs.js"></script>

        <script type="text/javascript" src="assets/js/kkpager.min.js"></script>

		<!-- inline scripts related to this page -->

        <script src="assets/js/jquery.cookie.js"></script>
        <script type="text/javascript">
            window.onload=function(){
                var name = $.cookie('username');
                if (name == '' || name == null || typeof(name)=="undefined"){
                    document.getElementById("user_name").innerText="unknown user";
                    alert("请先登录");
                    window.location.href='login';
                }

                document.getElementById("user_name").innerText=name;
            }

            $(function(){
                //生成分页
                //有些参数是可选的，比如lang，若不传有默认值
                kkpager.generPageHtml({
                    pno : '${pageInfo.page_index}',
                    //总页码
                    total : '${pageInfo.page_count}',
                    //总数据条数
                    totalRecords : '${pageInfo.count_info}',
                    mode : 'click',//默认值是link，可选link或者click
                    click : function(n){
                        // do something
                        window.location.href = '${pageInfo.page_href}'+ n+"&order_id="+${order_id?c};
                        //手动选中按钮
                        this.selectPage(n);
                        return false;
                    }
                });
            });

            jQuery(function($) {
                var oTable1 = $('#sample-table-2').dataTable( {
                    "aoColumns": [
                        { "bSortable": false },
                        null, null,null, null, null,
                        { "bSortable": false }
                    ] } );


                $('table th input:checkbox').on('click' , function(){
                    var that = this;
                    $(this).closest('table').find('tr > td:first-child input:checkbox')
                            .each(function(){
                                this.checked = that.checked;
                                $(this).closest('tr').toggleClass('selected');
                            });

                });


                $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
                function tooltip_placement(context, source) {
                    var $source = $(source);
                    var $parent = $source.closest('table')
                    var off1 = $parent.offset();
                    var w1 = $parent.width();

                    var off2 = $source.offset();
                    var w2 = $source.width();

                    if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
                    return 'left';
                }
            })

			$("#search_service_project").click(function(){
			    //型号
                var service_back_key = $("input[name='service_back_key']").val();
                //品牌
                var service_brand_key = $("#service_brand_key").val();
                //规格
                var service_standard_key = $("#service_standard_key").val();
                //部件
                var service_assembly_key = $("#service_assembly_key").val();
                //种类
                var service_kind_key = $("#service_kind_key").val();
                //分类
                var service_class_key = $("#service_class_key").val();
                //order_id
                var order_id = ${order_id?c};
                var href = "OrderAddServiceProject?order_id="+order_id;
                if(service_class_key != null && service_class_key != 0){
                    href = href+"&service_class="+service_class_key;
                }
                if(service_back_key.trim() != null && service_back_key.trim() != ''){
                    href = href + '&service_back='+service_back_key;
                }
                if(service_brand_key != null ){
                    href = href + '&service_brand='+service_brand_key;
                }
                if(service_standard_key != null ){
                    href = href + '&service_standard='+service_standard_key;
                }
                if(service_assembly_key != null ){
                    href = href + '&service_assembly='+service_assembly_key;
                }
                if(service_kind_key != null ){
                    href = href + '&service_kind='+service_kind_key;
                }
                href = href+'&page=1';
				window.location.href = href;
			});

		</script>
<#--<script type="text/javascript">-->
<#--var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");-->
<#--document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fe9e1d61340ff3d9495a8cca04ebdb49d' type='text/javascript'%3E%3C/script%3E"));-->
<#--</script>-->
<#--<a href="http://www.iteblog.com">过往记忆</a>-->
</body>
</html>
